package com.drpclub.gamebackend.common.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.sql.DataSource;

/**
 * @author ：drp
 * @date ：Created in 2020/5/7 23:57
 * @description：
 * @modified By：
 * @version: $
 */
@EnableTransactionManagement
@Configuration
public class TransactionConfigure {
    @Bean(name = "transactionManager")
    public PlatformTransactionManager txManager(DataSource dataSource) {
        return new DataSourceTransactionManager (dataSource);
    }
}
